<?php
/**
 *	Architect Framework
 *
 *	Architect Framework is a light weight object oriented web applications framework written for PHP 5.1.4 and later that provide the tools to develop and deploy a website or application fast and with as little code as possible.
 *
 *	@author Robin Grass, <hello@coffinboy.se>
 *	@link http://architect.kodlabbet.net
 *	@license http://www.opensource.org/licenses/gpl-3.0.html GNU General Public License (v. 3)
 */

/**
 *	Include all required files.
 */

require_once(dirname(__FILE__) . '/core-functions.php');
require_once(dirname(__FILE__) . '/core-setup.php');
require_once(dirname(__FILE__) . '/core-constants.php');
require_once(dirname(__FILE__) . '/core-locators.php');
require_once(dirname(__FILE__) . '/core-hooks.php');

try {
	
	/**
	 *	Hooks
	 */
	$hooks = Architect_HookAPI::getInstance();
	
	/**
	 *	Initialize Architect
	 */
	$hooks->invokeHooksByTrigger('pre_init');
	$arch = Architect::getInstance();
	$hooks->invokeHooksByTrigger('post_init');
	
	/**
	 *	Get bootstraps
	 */
	af_load('core-bootstraps.php');
	
	/**
	 *	Delegate
	 */
	$hooks->invokeHooksByTrigger('pre_delegation');
	$arch->router->delegate();
	$hooks->invokeHooksByTrigger('post_delegation');

} catch(Architect_Exception $exception) {

	Architect_ExceptionHandler::printException($exception);

}
?>